#!/bin/sh
# shell_awk.sh - Call test.awk in shell.
#           -- Usage: . shell_awk.sh config
echo "$1"
config=/usr/awknvar
#awk -f test.awk $1
# 在BEGIN段将shell变量传递到awk中
awk -F "=" 'BEGIN{nvar="'$config'"} {if ($1 == "config1") {gsub($2,nvar)} print $0 >>"1.log" }' $1
rm $1
mv 1.log $1
